<extend name="Base/common"/>

<block name="body">
    <!-- top end -->

    <!-- banner start -->
    <div class="banner_about"></div>
    <!-- banner end -->
    <div class="index-cen">
        <!-- 左侧橙色导航条 -->
        <div class="synopsis">
            <div class="box">
                <div class="crumbs">
                    <div class="left" style="float: left; border-left: 5px solid #7e1b1c; padding-left: 20px;">
                        <h3 style=" text-align: left; font-size: 36px;color: #7e1b1c; " >电商平台</h3>
                        <p style="text-align: right; color: #ddc8c0;font-size: 28px;">Platform</p>
                    </div>
                    <div class="right1" style="float: right;">
                        <img src="__IMG__/map.png">您的位置： <a href="/">首页</a> >> <a href="{:U('Platform/index')}">电商平台</a> >> <a title="title" href="javascript:void(0)">{$cate_info.title}</a>
                    </div>
                    <div class="clear"></div>
                </div>
                <div class="neirong_index">
                    <div class="inside-left">
                        <ul>
                            <volist name="cate_list" id="val">
                            <li><a title="cate" href="javascript:void(0)" onclick="list_page('{$val.id}',1,this)">{$val.title}</a></li>
                            </volist>
                        </ul>
                    </div>

                    <!--简介内容部分-->
                    <input type="hidden" name="cate_id" value="{$cate_id}"/>
                    <div id="data_info" style="width:75%; height: 800px;	background-color: #ffffff;	float: right;">
                        <p title="title" style="color: #666666;
	text-align: center;
	font-size: 24px;">{$cate_info.title}</p>
                        <div class="chanpin">

                            <ul>
                               <volist name="product_data['list']" id="val">
                                <li><a href="javascript:product_detail({$val.id})">
                                    <img src="{$val.cover_id|get_cover='path'}">
                                    <p>{$val.title}</p>
                                    <div class="price"><span>{$val.description}</span></div>
                                </a>
                                </li>
                               </volist>
                            </ul>
                        </div>
                        <div class="showpagebtn" style="margin-top: 30px;display: none;">

                        </div>
                    </div>
                    <div class="clear"></div>

                </div>
                <div class="page">
                    {$product_data.page}
                </div>



            </div>

        </div>
    </div>
    
</block>
<block name="footer_js">
    <script>
        function list_page(cate_id,p,o){
            if(cate_id==0){
                cate_id=$("input[name='cate_id']").val();
            }else{
                $("[title='cate']").css("color","white");
                $(o).css("color","red");
            }
             $.post("{:U('ajax_data')}",{cate_id:cate_id,p:p},function(data){
                if(data){
                    var str='';
                    $.each(data.list,function(k,v){
                        str+='<li>' +
                                '<a href="javascript:product_detail('+ v.id+')"> '+
                                '<img src="'+ v.img+'">' +
                                '<p>'+ v.title+'</p>'+
                                '<div class="price"><span>'+ v.description+'</span></div>'+
                                '</a>'+
                                '</li>';

                    });
                    $(".chanpin ul").html(str);
                    $("input[name='cate_id']").val(data.cate_id);
                    $("a[title='title']").text(data.cate_title);
                    $("p[title='title']").text(data.cate_title);
                    $(".page").html(data.page);
                    $(".page").css("display","block");
                    $("p[title='title']").css("display","block");
                    $(".showpagebtn").css("display","none");
                }
            });
        }
        function  product_detail(id){
            $.post("{:U('detail')}",{id:id},function(data){
                if(data){
                    $(".chanpin ul").html(data.content);
                    $(".page").css("display","none");
                    $("p[title='title']").css("display","none");
                    $(".showpagebtn").html(data.str);
                    $(".showpagebtn").css("display","block");
                }
            });
        }
        $(function(){
            var $window = $(window);
            $window.load(function(){
            });
        });
    </script>
</block>